/*
 * Copyright © 2019-2020  Whale Cloud, Inc. All Rights Reserved.
 *
 * Notice: Whale Cloud Inc copyrights this specification.
 * No part of this specification may be reproduced in any form or means,
 * without the prior written consent of Whale Cloud Inc.
 *
 */
package com.wteam.modules.system.domain;

import javax.validation.constraints.*;
import java.time.*;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import com.wteam.base.BaseCons;
import com.wteam.base.BaseEntity;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.*;

/**
 * 培养计划学分类型映射 持久类.
 *
 * @author herry_wong
 * @since 2020-12-29
 */
@Entity
@Getter
@Setter
@Where(clause = BaseCons.SOFT_DELETE)
@Table(name="develop_plan_credit_type_map")
public class DevelopPlanCreditTypeMap extends BaseEntity{

    public final static String ENTITY_NAME = "培养计划学分类型映射";

    @Id
    @NotNull(groups = Update.class)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /** 学分类别id */
    @ApiModelProperty( "学分类别id")
    @Column(name = "type_id")
    private Long typeId;

    /** 培养计划id */
    @ApiModelProperty( "培养计划id")
    @Column(name = "plan_id")
    private Long planId;

    /** 学分 */
    @ApiModelProperty( "学分")
    @Column(name = "credit")
    private Double credit;

    public void copy(DevelopPlanCreditTypeMap source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}